import clist from '../../fragment/list.vue'
export default {
    name: 'contentC',
    components: { clist },
    data() {
        return {
            person: {},
            list: this.$store.state.moduleA.personList,
            sexArr: [
                {
                    value: 0,
                    sex: '未知'
                }, {
                    value: 1,
                    sex: '男'
                }, {
                    value: 2,
                    sex: '女'
                },
            ],
            myarr: [1,2,3,4,5,6,7,8],
            arr: [
                {
                    id: 0,
                    name: 'ren0'
                }, {
                    id: 1,
                    name: 'ren1'
                }, {
                    id: 2,
                    name: 'ren2'
                }, {
                    id: 3,
                    name: 'ren3'
                }, {
                    id: 4,
                    name: 'ren4'
                }, {
                    id: 1,
                    name: 'ren5'
                },
            ]
        }
    },
    mounted() {
        // for (let i = 0; i < 10; i++) {
        //     console.log(i)
        // }

        // console.log(this.arr)

        this.$nextTick(function (){
            console.log(this.list[2]['id'])
            setTimeout(() => {
                console.log(this.myarr);

                this.myarr.length = 1;

                console.log(this.myarr);

                this.list[0] = {name:'askldfjsakdfj'};

                this.list[2]['id'] = '333';

                this.list[0] = {name:'123'};

                console.log(this.list)
            }, 3000);
        })


        // let ar = this.arr;
        // let e = ar.sort(function (a,b) {
        //     return -(a.id - b.id);
        // })
        // console.log(e)
    },
    methods: {
        add() {
            this.$store.commit('setPersonList', this.person)
        }
    }
}